﻿using TOUR.SZHOME.DAL;
using TOUR.SZHOME.Entity;
namespace TOUR.SZHOME.BLL
{
    /// <summary>
    /// 数据表Login的业务逻辑类
    /// </summary>
    public class LoginBLL
    {

        /// <summary>
        /// 根据用户名获取对象
        /// </summary>
        /// <param name="username"></param>
        /// <returns></returns>
        public LoginEntity GetModelByName(string username) 
        {
            return LoginDAL.GetByName(username);
        }

        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="newPwd"></param>
        /// <returns></returns>
        public bool ChangePwd(int userId, string newPwd)
        {
            return LoginDAL.ChangePwd(userId, newPwd);
        }

        /// <summary>
        /// 修改密码
        /// </summary>
        /// <param name="model"></param>
        /// <returns></returns>
        public bool CreateUser(LoginEntity model)
        {
            return LoginDAL.Insert(model);
        }
    }
}
